package com.ay277.htqoa.staff.entity;

import com.ay277.htqoa.base.entity.BaseEntity;
import com.ay277.htqoa.base.entity.User;


import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by accp09 on 2016/12/7.
 */
@Entity
@Table(name = "tb_employee")
public class Employee extends BaseEntity {
    private String name;
    private String gender;
    private Double sal;
    private Date hireDate;
    private String status;
    private int idCard;
    private Department department;
    private User login;

    @ManyToOne
    @JoinColumn(name = "login_id",unique = true)
    public User getLogin() {
        return login;
    }

    public void setLogin(User login) {
        this.login = login;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getIdCard() {
        return idCard;
    }

    public void setIdCard(int idCard) {
        this.idCard = idCard;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Double getSal() {
        return sal;
    }

    public void setSal(Double sal) {
        this.sal = sal;
    }

    public Date getHireDate() {
        return hireDate;
    }

    public void setHireDate(Date hireDate) {
        this.hireDate = hireDate;
    }

    @ManyToOne
    @JoinColumn(name = "department_Id")
    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }
}
